package com.uspacex.calculate.mapper;

import com.uspacex.calculate.entity.TaskDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

@Mapper
public interface taskDetailMapper {
    TaskDetail findByTaskId(@Param("taskId") String taskId);

    List<TaskDetail> findAll();

    void delete(@Param("taskId") String taskId);

    int getId(@Param("taskId") String taskId);

    void finish(@Param("taskId") String taskId);
    //String getTableName(@Param("taskId") String taskId);

    // MARK Map改为LinkedHashMap
    List<LinkedHashMap<String, Object>> output1(@Param("tableName") String tableName, @Param("DBname") String DBname, @Param("pri_name") String pri_name, @Param("Id") int Id, @Param("start") int start, @Param("end") int end);

    // MARK Map改为LinkedHashMap
    List<LinkedHashMap<String, Object>> output2(@Param("Id") int Id);

    void save_process(@Param("process") Double process, @Param("taskId") String taskId);

    void completeTime(@Param("completeTime") Date completeTime, @Param("taskId") String taskId);

    int insertAndReturnId(@Param("taskDetail") TaskDetail taskDetail);

    void updateTableName(@Param("taskDetail") TaskDetail taskDetail);

    Double findProcess(@Param("taskId") String taskId);

    //boolean isFinished(@Param("taskId") String taskId);
    // MARK New Added
    List<LinkedHashMap<String, Object>> showColumns(@Param("tableName") String tableName, @Param("DBname") String DBname);
}
